#!/usr/bin/python

import sys

for eachLine in sys.stdin:
    eachLine = eachLine.strip()
    usr_id = eachLine.split("\t")[0]
    usr_query = eachLine.split("\t")[1]

    for eachKeyword in usr_query.split(" "):
        if(eachKeyword.strip() != ""):
            print usr_id+"\t"+eachKeyword


